var canvas = document.getElementsByClassName("video")[0];
var context = canvas.getContext("2d");
var m = 1;
canvas.width = document.documentElement.clientWidth||document.body.clientWidth;
canvas.height = document.documentElement.clientHeight||document.body.clientHeight;
$(".wrap").on("touchstart",function(ev){
	$(".wrap").hide();
	carMove();
	return false;
});
$(".wrap").on("touchend",function(){
	$(".wrap").show();
	clearInterval(timer);
	if(m >= 235){
		$(".video").hide();
		$(".wrap").hide();
		$(".box").show();
		$(".choujiang").height($("#zhuanpan").height());
	}
});
var img = new Image;
img.src = "images/che_" + m + ".jpg";
img.onload = function(){
	context.beginPath();
	context.drawImage(img,0,0,canvas.width,canvas.height);
}
function carMove(){
	timer = setInterval(function(){
		m++;
		var img = new Image();
		img.src = "images/che_" + m + ".jpg";
		img.onload = function(){
			context.beginPath();
			context.drawImage(img,0,0,canvas.width,canvas.height);
		}
		if(m >= 235){
			clearInterval(timer);
		}
	},45);
}
